home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10186 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.2 KB  |  50 lines

  1. Newsgroups: comp.lang.c
  2. Path: news.sprintlink.net!news1!ind-003-236-135
  3. From: dlmiller@iquest.net (Doug Miller)
  4. Subject: Re: prototype error
  5. X-Nntp-Posting-Host: ind-003-236-135.iquest.net
  6. Message-ID: <DoBAnD.KrG@iquest.net>
  7. Sender: news@iquest.net (News Admin)
  8. Organization: IQuest Network Services
  9. X-Newsreader: News Xpress Version 1.0 Beta #2.1
  10. References: <4i8688$1gr@cloner4.netcom.com>
  11. Date: Fri, 15 Mar 1996 13:57:02 GMT
  12.  
  13. brenth@ix.netcom.com(harold brent hyatt) wrote:
  14.  
  15. +I copied this program from a C primer and get an error as follows:
  16. +"Call to function sound, delay, nosound with no prototype."
  17. +I'm using a Borland 3.1 C++ compiler in the EasyWin mode. I have
  18. +tried switching the compiler from ANSI to Borland C++, but with the
  19. +same result. What's wrong? Thanks.
  20. +
  21. +#include <stdio.h>
  22.  
  23. Possibly the lack of a space between '#include' and '<' on the next two lines.
  24. BTW -- this program compiles clean as written under Borland TurboC++ v2.0.
  25.  
  26. +#include<conio.h>
  27. +#include<dos.h>
  28. +
  29. +void dropBomb (void);
  30. +
  31. +main()
  32. +{
  33. +    printf("Press any key to drop bomb:\n");
  34. +    getch();
  35. +    dropBomb();
  36. +    printf("\nYikes!\n");
  37. +}
  38. +void dropBomb()
  39. +{
  40. +    int x;
  41. +
  42. +    for(x=880;x>440;x-=10)
  43. +    {
  44. +        sound(x);
  45. +        delay(100);
  46. +    }
  47. +    nosound();
  48. +}
  49.  
  50.